package com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.xiaoxing.zhinenghuacangku_nanjinglu.R;
import com.xiaoxing.zhinenghuacangku_nanjinglu.R2;
import com.xiaoxing.zhinenghuacangku_nanjinglu.di.component.DaggerNanJingLu_YiBanHeDianBiaoXuanZeComponent;
import com.xiaoxing.zhinenghuacangku_nanjinglu.di.module.NanJingLu_YiBanHeDianBiaoXuanZeModule;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.contract.NanJingLu_YiBanHeDianBiaoXuanZeContract;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.presenter.NanJingLu_YiBanHeDianBiaoXuanZePresenter;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.entity.NanJingLu_YiBanHeDianBiaoXuanZe;

import java.util.HashMap;

import butterknife.OnClick;
import com.jess.arms.utils.CProgressDialogUtils;
import me.jessyan.armscomponent.commonres.utils.ToolbarUtils;
import me.jessyan.armscomponent.commonsdk.core.RouterHub;
import me.jessyan.armscomponent.commonsdk.utils.Utils;

import static com.jess.arms.utils.Preconditions.checkNotNull;

/**
 * @ProjectName: 青岛-南京路自动化仓库
 * @Package: com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.activity
 * @ClassName: NanJingLu_YiBanHeDianBiaoXuanZeActivity
 * @Description: 出库、入库操作分为一般操作和电表操作，用于选择一般操作还是电表操作
 * @Author: 小星
 * @CreateDate: 2020/6/14 0014 16:26
 * @UpdateUser: 更新者：
 * @UpdateDate: 2020/6/14 0014 16:26
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
@Route(path = RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU_YI_BAN_HE_DIAN_BIAO_XUAN_ZE)
public class NanJingLu_YiBanHeDianBiaoXuanZeActivity extends BaseActivity<NanJingLu_YiBanHeDianBiaoXuanZePresenter> implements NanJingLu_YiBanHeDianBiaoXuanZeContract.View {


    @Override
    public void setupActivityComponent(@NonNull AppComponent appComponent) {
        DaggerNanJingLu_YiBanHeDianBiaoXuanZeComponent //如找不到该类,请编译一下项目
                .builder()
                .appComponent(appComponent)
                .nanJingLu_YiBanHeDianBiaoXuanZeModule(new NanJingLu_YiBanHeDianBiaoXuanZeModule(this))
                .build()
                .inject(this);
    }

    @Override
    public int initView(@Nullable Bundle savedInstanceState) {
        return R.layout.activity_nan_jing_lu__yi_ban_he_dian_biao_xuan_ze; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {

        ToolbarUtils.initToolbarTitleBack(this, getString(R.string.activity_nan_jing_lu__yi_ban_he_dian_biao_xuan_ze));
        //getNanJingLu_YiBanHeDianBiaoXuanZeData();
    }

    /**
     * @param
     * @return
     * @method 一般操作, 跳转到 {@link NanJingLu_MenuSelectionActivity}
     * @description 出库、入库操作分为一般操作和电表操作
     * @date: 2020/6/14 0014 16:23
     * @author: 小星
     */
    @OnClick(R2.id.btn_yi_ban_cao_zuo)
    public void yiBanCaoZuo() {
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NanJingLu_MENU_SELECTION_ACTIVITY);
    }

    /**
     * @param
     * @return
     * @method 电表操作, 跳转到 {@link NanJingLu_DianBiaoGongNengCaoZuoXuanZeActivity}
     * @description 出库、入库操作分为一般操作和电表操作
     * @date: 2020/6/14 0014 16:24
     * @author: 小星
     */
    @OnClick(R2.id.btn_dian_biao_cao_zuo)
    public void dianBiaoCaoZuo() {
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU__DIAN_BIAO_GONG_NENG_CAO_ZUO_XUAN_ZE);
    }

    @OnClick(R2.id.btn_chou_jian_chu_ku)
    public void chouJianChuKu() {
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_ZHI_JIAN_ACTIVITY_CHOU_JIAN_CHU_KU_LIE_BIAO);
    }

    @Override
    public void getNanJingLu_YiBanHeDianBiaoXuanZeDataSuccess(NanJingLu_YiBanHeDianBiaoXuanZe entityData) {


    }

    private void getNanJingLu_YiBanHeDianBiaoXuanZeData() {
        HashMap<String, String> map = new HashMap<>();

        mPresenter.getNanJingLu_YiBanHeDianBiaoXuanZeData(map);
    }


    @Override
    public void showLoading() {
        CProgressDialogUtils.showProgressDialog(this);
    }

    @Override
    public void hideLoading() {
        CProgressDialogUtils.cancelProgressDialog(this);
    }

    @Override
    public void showMessage(@NonNull String message) {
        checkNotNull(message);
        ArmsUtils.makeText(this, message);
    }

    @Override
    public void launchActivity(@NonNull Intent intent) {
        checkNotNull(intent);
        ArmsUtils.startActivity(intent);
    }

    @Override
    public void killMyself() {
        finish();
    }
}
